﻿//-------------------------------------------------------------------------------------------------
// <copyright file="Neo4JBase.cs" company="BeeWix">
// BeeWix. Licensed under MIT
// </copyright>
//-------------------------------------------------------------------------------------------------

namespace BeeWix.Toolkit.NoSql.Neo4J
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using BeeWix.Toolkit.Dynamic;
    using System.Xml.Serialization;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class Neo4JBase
    {
        [XmlIgnore]
        internal string jsonData { get; set; }
        [XmlIgnore]
        private dynamic pData;
        [XmlIgnore]
        internal dynamic Data 
        { 
            get
            {
                if (pData == null)
                {
                    if (string.IsNullOrWhiteSpace(jsonData))
                    {
                        jsonData = @"{""data"":{}}";
                    }
                    pData = DynamicJson.Parse(jsonData);
                }

                return pData;
            }
        }
    }
}
